package com.yvdedu.hospital.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.yvdedu.hospital.entity.Department;
import com.yvdedu.hospital.entity.Drug;
import com.yvdedu.hospital.entity.Outpatient;
import com.yvdedu.hospital.entity.Prccs;
import com.yvdedu.hospital.entity.Presc;
import com.yvdedu.hospital.entity.Prescription;
import com.yvdedu.hospital.entity.Project;
import com.yvdedu.hospital.entity.Record;
import com.yvdedu.hospital.entity.User;
import com.yvdedu.hospital.entity.tool.OutpatientTool;
import com.yvdedu.hospital.entity.tool.PrccsTool;
import com.yvdedu.hospital.entity.tool.PrescTool;
import com.yvdedu.hospital.mapper.RegistrationMapper;
import com.yvdedu.hospital.service.RegistrationService;

@Service
public class RegistrationSer implements RegistrationService {
	
	@Resource
	RegistrationMapper registrationMapper;


	@Override
	public List<Outpatient> outpatientquery() {
		List<Outpatient> list = registrationMapper.outpatientquery();
		return list;
	}

	@Override
	public void outpatientadd(Outpatient outpatient) {
		registrationMapper.outpatientadd(outpatient);
		
	}
	
	@Override
	public List<Department> departmentquery() {
		
		List<Department> list = registrationMapper.departmentquery();
		
		return list;
	}
	
	@Override
	public List<User> userquery(int dep_id) {
		List<User> list = registrationMapper.userquery(dep_id);
		return list;
	}

	@Override
	public List<Outpatient> searchoutpatient(String name) {
		PageHelper.startPage(1, 8);
		List<Outpatient> list = registrationMapper.searchoutpatient(name);
		
		return list;
	}

	@Override
	public List<Project> projectquery() {
		List<Project> list = registrationMapper.projectquery();
		return list;
	}

	@Override
	public List<Drug> drugSerch(String name,int pageNumber) {
		PageHelper.startPage(pageNumber, 5);
		List<Drug> list = registrationMapper.drugSerch(name);
		return list;
	}

	@Override
	public List<Project> projectSerch(String name) {
		List<Project> list = registrationMapper.projectSerch(name);
		return list;
	}

	@Override
	public List<Outpatient> outpatientque(String deal) {
		List<Outpatient> list = registrationMapper.outpatientque(deal);
		return list;
	}

	@Override
	public void prescriptionadd(Prescription prescription) {
		registrationMapper.prescriptionadd(prescription);
		
	}

	@Override
	public void prescadd(Presc presc) {
		registrationMapper.prescadd(presc);
		
	}

	@Override
	public void prccsadd(Prccs prccs) {
		registrationMapper.prccsadd(prccs);
		
	}

	@Override
	public void outpatientedit(Outpatient outpatient) {
		registrationMapper.outpatientedit(outpatient);
	}

	@Override
	public void drugedit(Drug drug) {
		registrationMapper.drugedit(drug);
	}

	@Override
	public List<OutpatientTool> outpatientcases(String cases) {
		List<OutpatientTool> list = registrationMapper.outpatientcases(cases);
		return list;
	}

	@Override
	public void recordadd(Record record) {
		
		registrationMapper.recordadd(record);
		
	}

	@Override
	public void casesedit(Outpatient outpatient) {
		registrationMapper.casesedit(outpatient);
	}

	@Override
	public List<PrescTool> serch(int p_id,int pageNumber) {
//		System.out.println(p_id+"---------sever");
		PageHelper.startPage(pageNumber, 3);
		List<PrescTool> list = registrationMapper.serch(p_id);
//		System.out.println(list+"------sever");
		return list;
	}

	@Override
	public List<PrccsTool> serch1(int p_id,int pageNumber) {
		PageHelper.startPage(pageNumber, 3);
		List<PrccsTool> list = registrationMapper.serch1(p_id);
		return list;
	}

	@Override
	public void intdeit(int id) {
		registrationMapper.intdeit(id);
	}
	@Override
	public void intdeit1(int id) {
		registrationMapper.intdeit1(id);
	}
	@Override
	public void intdeit2(int id) {
		registrationMapper.intdeit2(id);
	}
	@Override
	public void intdeit3(int id) {
		registrationMapper.intdeit3(id);
	}



}
